import React, { Component } from 'react';
import FilterTable from './components/FilterTable';
import axios from 'axios';
import cookie from 'react-cookies';

export default class Page10 extends Component {
  static displayName = 'Page10';

  constructor(props) {
    super(props);
    this.state = {};
  }
  componentDidMount() {
    // const username = this.props.location.state.username;
    // console.log(username);
    // console.log('**',cookie.load('user'))
    // console.log('*^*',cookie.load('user') !== 'asd');
    // const test = this.props.location.state;
    // console.log(test);
    const baseurl = 'http://39.105.21.199:8989/IPEvaluation/evaluateManage/userShowEvaluateList.do?sessionId=';
    const sessionid = cookie.load('sessionId');
    axios.post(baseurl + sessionid).then((response) => {
      console.log(response.data.data);
      console.log(response.data.msg);
      const msg = response.data.msg;
      console.log('eqewq')
      if (msg === 'LoginInvalidate') {
        this.props.history.push('/pagelogin');
      }
    }).catch((error) => {
      console.log(error);
    });
  }

  render() {
    return (
      <div className="page10-page">
        <FilterTable />
      </div>
    );
  }
}
